package com.heima.article.config;

import com.heima.article.interceptor.ApUserTokenInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 指定拦截路径规则
        registry.addInterceptor(new ApUserTokenInterceptor()).addPathPatterns("/**"); // 拦截所有请求
    }
}
